﻿using DXApplicationTangche.UC.盘点.Service;
using DXApplicationTangche.UC.订单一览新.订单预览新.model;
using DXApplicationTangche.UC.门店出入库.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.门店出入库
{
    public partial class Form库存查询 : DevExpress.XtraEditors.XtraForm
    {
        private List<ViewStockInDetailDTO> viewStockInDetailDTOs = new List<ViewStockInDetailDTO>();
        private 订单预览新Model model;
        public Form库存查询()
        {
            InitializeComponent();
        }

        private void textBox扫成衣码查库存_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                if (String.IsNullOrEmpty(this.textBox扫成衣码查库存.Text.Trim()))
                {
                    MessageBox.Show("请扫码");
                    return;
                }
                try
                {
                    this.model = new 订单预览新Model(this.textBox扫成衣码查库存.Text.Trim(), Enum订单查询.按照水洗标查询订单);
                }
                catch (Exception)
                {
                    MessageBox.Show("请正确扫描成衣条码");
                    return;
                }
                this.model.buildOrderCommit();
                this.label款式名称.Text = "款式名称:" + this.model.OrderCommitDTO返回.styleNameCn;
                //款式
                this.gridControl款式.DataSource = this.model.款式DTOs;
                //设计点
                this.gridControl设计点.DataSource = this.model.设计点DTOs;
                //面料
                this.gridControl面料.DataSource = this.model.面料DTOs;
                this.viewStockInDetailDTOs = 出入库Service.getViewStockInDetailByBarcode(this.textBox扫成衣码查库存.Text.Trim());
                this.pivotGridControl同款在库一览.DataSource = this.viewStockInDetailDTOs;
                this.pivotGridControl同款在库一览.RefreshData();
                //this.pivotGridField4.ExpandAll
            }
        }
    }
}
